[?php  $tipo_despliegue = sfContext::getInstance()->getRequest()->getParameter('tipo_despliegue', 'div'); ?]
[?php

 $update = "div_panel_contenido";
 $params = "";
 if($tipo_despliegue != 'div')
 {
	$update = "div_edit_succes";	
?]

[?php     echo input_hidden_tag("tipo_despliegue", "ventana"); ?]
[?php
 }
?]
<ul class="sf_admin_actions">
<?php $editActions = $this->getParameterValue('edit.actions') ?>
<?php if (null !== $editActions): ?>
<?php foreach ((array) $editActions as $actionName => $params): ?>
  <?php if ($actionName == '_delete') continue ?>
  <?php echo $this->addCredentialCondition($this->getButtonToActionAjax($actionName, $params, true), $params) ?>
<?php endforeach; ?>
<?php else: ?>

   <li>[?php echo submit_to_remote('save', 'Guardar', array (
  'method' => 'POST',
  'before' => 'if($("accion_formulario")){ $("accion_formulario").value="save";}',
  'update' => 
  array (
    'success' => $update,
    'failure' => 'div_error',
  ),
  'url' => '<?php echo $this->getModuleName() ?>/save?'.$params,
), array (
  'name' => 'save',
  'class' => 'sf_admin_action_save',
) ) ?]
</li>

[?php  if(!$<?php echo $this->getSingularName() ?>->isNew()):        ?]
<li>
<?php $url_detalle = $this->getParameterValue('detalles.modulo');

      $params = $this->getPrimaryKeyUrlParamsForDetails();
      
      $url_detalle .= "/create?".$params."";
 ?>


<div id="delete_button" style="display: inline">
  <li>[?php echo button_to_prototype_window_ajax(__('Agregar Detalle'), 'win_detalle', array (
  'url' => '<?php echo $url_detalle ?>,
  'script' => true,
  'method' => 'GET',
) , array('right'=>300, 'left'=>20 )) ?]&nbsp;&nbsp;
</div>
</li>
[?php endif; ?]

[?php

 if($tipo_despliegue == 'div'): 
?]
  <li>[?php echo submit_to_remote('save_and_add', 'Guardar y Adicionar', array (
  'method' => 'POST',
  'before' => 'if($("accion_formulario")){ $("accion_formulario").value="save_and_add";}',
  'update' => 
  array (
    'success' =>  $update ,
    'failure' => 'div_error',
  ),
  'url' => '<?php echo $this->getModuleName() ?>/save',
), array (
  'name' => 'save_and_add',
  'class' => 'sf_admin_action_save_and_add',
) ) ?]</li>

[?php endif; ?]

<?php endif; ?>
</ul>




